﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="ProjectStudy.WebForm4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#ip1").keydown(function (e) {
                var e = e || window.event || arguments.callee.caller.arguments[0];
                var code = e.keyCode || e.which;
                if (e && code == 27) { // 按 Esc 
                    //要做的事情
                    alert("按下了ESC");
                }
                if (e && code == 113) { // 按 F2 
                    //要做的事情
                    alert("按了F2");
                }
                if (e && code == 13) { // enter 键
                    //要做的事情
                    alert("按了enter");
                }
            });

            var isAllCheck = false;
            $("#btn1").click(function () {
                if (!isAllCheck) {
                    $("input[type='checkbox']").attr("checked", "checked");
                    isAllCheck = true;
                }
                else {
                    $("input[type='checkbox']").removeAttr("checked");
                    isAllCheck = false;
                }

                //                $("input[type='checkbox']").each(function (i) {
                //                    $(this).attr("checked", true);
                //                });
            });

            $("table a").click(function () {
                if (confirm("确认删除？")) {
                    $(this).parent().parent().remove();
                }

            });
        });

        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <label></label>
      <a id="a1">dd</a>
      <input  type="text" id="ip1"/>
      <br />
      <input  type="button" id="btn1" value="全选"/>
      <br />
      <input  type="checkbox"/>
      <br />
      <input  type="checkbox"/>
      <br />
      <input  type="checkbox"/>
      <br />
      <input  type="checkbox"/>
      <br />
      <table>
        <tr>
          <th>序号</th>
          <th>班级</th>
          <th>是否删除</th>
        </tr>
        <tr id="tr1">
          <td>1</td>
          <td>1班</td>
          <td id="td1"><a  href="#">删除</a></td>
        </tr>

        <tr id="tr2">
          <td>2</td>
          <td>2班</td>
          <td id="td2"><a  href="#">删除</a></td>
        </tr>

        <tr id="tr3">
          <td>3</td>
          <td>3班</td>
          <td id="td3"><a  href="#">删除</a></td>
        </tr>
      </table>
      </div>
    </form>
</body>
</html>
